<?php
$de = new Zend_Locale('de_DE');
$latestUpdateDate = new Zend_Date('2000-01-01',$de);
$publishedDate = new Zend_Date(Zend_Date::now(),$de);
// tags
if(is_array($this->tags)){
	foreach($this->tags as /* @var $tag Website_Model_Tag */ $tag){
		$date = new Zend_Date($tag->updateDate,Zend_Date::ISO_8601);
		// update latest update date (for feed attribute)
		if($date->isLater($latestUpdateDate)){
			$latestUpdateDate = $date;
		}
		$entries[] = $tag->toFeedEntry();
	}
}

// Create the RSS array
$rss = array(
	'title'   		=> 	'Liste aller Tags - cocktailberater.de',
	'description'	=>	'Alle Tags des cocktailberaters.',
	'link'    		=> 	$this->url().'?format='.$this->format,
	'author'		=>	'cocktailberater.de '.APPLICATION_VERSION,
	'email'			=>	'info@cocktailberater.de',
	'webmaster'		=>	'info@thobach.de',
	'image'			=>	$this->baseUrl().'/img/logo.png',
	'generator'		=>	'cocktailberater '.APPLICATION_VERSION,
	'language'		=>	'de',
	'published'		=> 	$publishedDate->getTimestamp(),
	'lastUpdate'	=> 	$latestUpdateDate->getTimestamp(),
	'charset' 		=> 	'UTF-8',
	'entries' 		=> 	$entries
);

// Import the array
$feed = Zend_Feed::importArray($rss, $this->format);
print $feed->saveXML();